//
//  KBFileManager.h
//  KBKit
//
//  Created by yunqili on 2021/4/12.
//  Copyright © 2021 adad. All rights reserved.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN
typedef void (^KBFileManagerCompletaionHandler)(NSError *error);
@interface KBFileManager : NSObject
+ (instancetype)shareInstance;

- (instancetype)initWithIoQueue:(dispatch_queue_t)ioQueue;

+ (BOOL)tryGreateDir:(NSString *)dir;

+ (BOOL)exitItemWithPath:(NSString*)path;

- (void)saveDate:(NSData*) aData pathUrl:(NSURL*)pathUrl completaionHandler:(KBFileManagerCompletaionHandler)completaionHandler;

- (void)saveDate:(NSData*) aData ToFile:(NSString *)file completaionHandler:(KBFileManagerCompletaionHandler)completaionHandler;

- (void)moveItemAtURL:(NSURL *)srcURL toURL:(NSURL *)dstURL completaionHandler:(KBFileManagerCompletaionHandler)completaionHandler;

- (void)tryCreateDictionaryWithPath:(NSString*)path completaionHandler:(KBFileManagerCompletaionHandler)completaionHandler;

- (void)removeFileWithPath:(NSString *)path;

- (float ) folderSizeAtPath:(NSString*) folderPath;

-(float)getFreeDiskSize;

-(float)getTotalDiskSize;

FOUNDATION_EXPORT NSString * const KBM3u8FileManagerWriteErrorDomain;
@end

NS_ASSUME_NONNULL_END
